preetg 0 Junior Poster in Training

hi............
m using javascript and css for creating horizontal menu for my project.... but i m facing prob regarding their direction..... i want sub menu should open in right direction but not below the main menu items. ........ help me out.

var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.
  var transOptions= "gradientSize=[0..1], wipestyle=0/1, motion=right";
function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)
.horizontalcssmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}

/*Top level list items*/
.horizontalcssmenu ul li{
position: relative;
display: inline;
float: left;

}

/*Top level menu link items style*/
.horizontalcssmenu ul li a{
display: block;
width: 120px; /*Width of top level menu link items*/
height:20px;
padding: 2px 8px;
border: 1px solid #202020;
border-left-width: 0;
text-decoration: none;
background:#4682B4;
color: White;
font: bold 13px Tahoma;
}
	
/*Sub level menu*/
.horizontalcssmenu ul li ul{


left: o;
top: 0;
border-top: 1px solid #202020;
position: absolute;
display: block;
visibility: hidden;
z-index: 100;
float: right;
}

/*Sub level menu list items*/
.horizontalcssmenu ul li ul li{
display: inline block;
float: right;
}


/* Sub level menu links style */
.horizontalcssmenu ul li ul li a{
width: 160px; /*width of sub menu levels*/
font-weight: bold;
padding: 2px 5px;
background: #BCD2EE;
border-width: 0 1px 1px 1px;
}

.horizontalcssmenu ul li a:hover{
background: #4682B4; 
}

.horizontalcssmenu ul li ul li a:hover{
background: #4682B4;
}

.horizontalcssmenu .arrowdiv{
position: absolute;
right: 0;
background: transparent url(menuarrow.gif) no-repeat center left;
}

* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/
padding-top: 1em;
}
	
/* Holly Hack for IE \*/
* html .horizontalcssmenu ul li { float: left; height: 1%; }
* html .horizontalcssmenu ul li a { height: 1%; }
/*
<html>
<head>
<link rel="stylesheet" type="text/css" href="csshorizontalmenu.css" />

<script type="text/javascript" src="csshorizontalmenu.js">

</script>
</head>
<body bgcolor="E6E6FA">

<div class="horizontalcssmenu">
<ul id="cssmenu1">
<li><a href="#" >Masters</a>
<ul>
<li><a href="a.html"> A </a> </li>
<li><a href="a.html"> b </a> </li>
<li><a href="a.html"> c </a> </li>
<li><a href="a.html"> d </a> </li>
</ul> </li>
<li><a href="#">Processing</a>
<ul>
<li><a href="a.html"> X </a> </li>
<li><a href="a.html"> Y </a> </li>
<li><a href="a.html"> Z </a> </li>
<li><a href="a.html"> W </a> </li>
</ul> 

</li>
<li><a href="#">Reports</a>
    <ul>
    <li><a href="a.html">A</a></li>
    <li><a href="b.html">B</a></li>
    <li><a href="c.html">C</a></li>
    </ul>
</li>
<li><a href='#">Utilities</a>
<ul>

    <li><a href="gk.html">GK</a></li>
    <li><a href="pk.html">PK</a></li>
    <li><a href="ah.html">AH</a></li>
     </ul>
</li>
</ul>



<br style="clear: left;" />
</div>


</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.